﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Delonix_Regia_Hotel_Management_System.Class;

namespace Delonix_Regia_Hotel_Management_System
{
    public partial class All_Guest_In_All_Rooms_Report : Form
    {
        public All_Guest_In_All_Rooms_Report()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Form1 F = new Form1();
            this.Hide();
            F.Show(); 
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (LogInClass.position == "Administrator")
            {
                Main__Management_and_Administrator_ mainA = new Main__Management_and_Administrator_();
                this.Hide();
                mainA.Show();
            }
            else
            {
                Main__Receptionist_ mainR = new Main__Receptionist_();
                this.Hide();
                mainR.Show();
            }


        }

        private void All_Guest_In_All_Rooms_Report_Load(object sender, EventArgs e)
        {

        }

        private void btnSearch_Click(object sender, EventArgs e)
        {
            List<Room> room = new List<Room>();

            string searchDate = Convert.ToString(dateTimePicker1.Value.Date.Year + "/" + dateTimePicker1.Value.Date.Month + "/" + dateTimePicker1.Value.Date.Day);

            room = DBManager.getRoomByDate(searchDate);
            

            BindingSource binding = new BindingSource();
            binding.DataSource = room;
            dataGridView1.DataSource = binding;

            dataGridView1.Columns["roomStatus"].Visible = false;
            dataGridView1.Columns["roomStartingDate"].Visible = false;
            dataGridView1.Columns["roomEndingDate"].Visible = false;
            dataGridView1.Columns["roomType"].Visible = false;
        }
    }
}
